import java.util.Arrays;

public class ArrayTest {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int[] a = { 1, 2, 3, 4, 5, 6 };
		
		System.out.println(Arrays.toString(a));
		for(int el:a) {
			System.out.println("el: "+ el);
		}
		
		a = new int[] {7,8,9};  // anonymous array
		
		
		for(int i=0;i<a.length;i++) {
			System.out.println(a[i]);
		}
		
		
		String b[]  = {"string1","string2"};
		for(int i=0;i<b.length;i++) {
			System.out.println(b[i]);
		}
		 
//		System.out.print(b[2]);  // Index 2 out of bounds
		
		// Copy
		
//		String c[] = b;
		String d[] = Arrays.copyOf(b, b.length);
		System.out.println("d: "+Arrays.toString(d));
		
		String e[] = Arrays.copyOf(b, b.length*2);
		System.out.println("e: "+Arrays.toString(e));
		e[3] ="asdfasdffas";
		System.out.println(Arrays.toString(e));
		
		
		

	}
}
